package com.cy.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import java.util.*;

@RestController
@RequestMapping("/provider/")
public class RestProviderController {
    @DeleteMapping("{id}")
    public String doDeleteById(@PathVariable long ... id){
        return Arrays.toString(id)+"is deleted";
    }
    @PostMapping
    public Map<String,Object>  doCreate(@RequestBody Map<String, Object> map) {
        System.out.println("provider.map=" + map);
        Map<String, Object>  responsemap = new HashMap<>();
        responsemap.put("status", 200);
        responsemap.put("msg", "insert ok");
        return responsemap;
    }
    @PutMapping
    public Map<String,Object>  doupdate(@RequestBody Map<String, Object> map) {
        System.out.println("provider.map=" + map);
        Map<String, Object>  responsemap = new HashMap<>();
        responsemap.put("status", 200);
        responsemap.put("msg", "insert ok");
        return responsemap;
    }

}






